exports.install = function (Vue, options) {
  Vue.prototype.deleteExpiryHistory = function () {
    for (let i = 0; i < localStorage.length; i++) {
      var startIndex = localStorage.key(i).indexOf('E-20')
      if (startIndex === 0) {
        var key = localStorage.key(i)
        var keyString = localStorage.key(i).substring(2)
        // console.log(keyString)
        var moment = require('moment')
        var saveTime = moment(keyString, 'YYYY/MM/DD/hh:mm:ss')
        var expriationTime = moment().add(this.$store.state.MAX_HISTORY_DAYS, 'days')
        if ((saveTime - expriationTime) < 0) {
          localStorage.removeItem(key)
          console.log('FunctionName:deleteExpiryHistory,Action: Record was deleted OK')
        }
        console.log('FunctionName:deleteExpiryHistory,Action: No Record can be delete')
      }
    }
    console.log('FunctionName:deleteExpiryHistory,Action: function completely')
  }
}
